import { stringify } from 'qs';
import request from '../utils/request';

export async function addPhase(payload) {
  return request(`/gamePhase/`, {
    method: 'POST',
    body: payload
  });
}

export async function modifyPhase(payload) {
  
  return request(`/gamePhase/`, {
    method: 'PATCH',
    body: payload,
  });
}

export async function deletePhase(id) {
  return request(`/gamePhase/${id}`, {
    method: 'DELETE',
    body: payload,
  });
}

export async function finish(phaseCode) {
  return request(`/gamePhase/finish/${phaseCode}`, {
    method: 'POST',
    body: {},
  });
}

export async function findPhaseTeam(params) {

  const { phaseCode, headers } = params;
  return request(`/gameUserGroup/phaseTeam/${phaseCode}`, {
    headers: headers?headers:{'x-page-num': 1,
    'x-page-size': 20},
    method: 'GET',
  });

}